package com.slz3.business.module.memberManagement.memRecord.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.memberManagement.memRecord.domain.MemRecord;
import com.slz3.business.module.memberManagement.memRecord.domain.MemRecordCondition;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

public class MemRecordResAtomic {

    static Mono<ServerResponse> add_$MemRecordUpdateLock(ServerRequest req, MemRecord memRecord) {
        return MemRecordResSafeValid.add(req, memRecord) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.add(req, memRecord);
    }

    public static Mono<ServerResponse> delete_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.delete(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.delete(req);
    }

    static Mono<ServerResponse> modify_$MemRecordUpdateLock(ServerRequest req, MemRecord memRecord) {
        return MemRecordResSafeValid.modify(req, memRecord) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.modify(req, memRecord);
    }

    static Mono<ServerResponse> info_$MemRecordUpdateLock(ServerRequest req) {
        return MemRecordResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.info(req);
    }

    public static Mono<ServerResponse> auditSubmit_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.auditSubmit(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.auditSubmit(req);
    }

    public static Mono<ServerResponse> audit_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.audit(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.audit(req);
    }

    public static Mono<ServerResponse> auditReject_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.auditReject(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.auditReject(req);
    }


    public static Mono<ServerResponse> usingEnable_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.usingEnable(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.usingEnable(req);
    }

    public static Mono<ServerResponse> usingDisable_$MemRecordUpdateLock(ServerRequest req, MemRecordCondition memRecordCondition) {
        return MemRecordResSafeValid.usingDisable(req, memRecordCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MemRecordResExecutor.usingDisable(req);
    }
}
